#ifndef QUEUE_H_
#define QUEUE_H_
//This queue will contain Customer items
class Customer
{
private:
    long arrive;//arrival time for customer
    int processtime;//processing time for customer
public:
    Customer() {arrive = processtime = 0;}
    void set(long when);
    long when() const {return arrive;}
    int ptime() const {return processtime;}
};

typedef Customer Item;

class Queue
{
private:
    //class scopoe definition
    //Node is a nested structure definition local to this c
    struct Node{Item item;struct Node * next;};
    enum{Q_SIZE = 10};
    //private class memebers
    Node * front;//指向Queue开始
    Node * rear;//指向Queue结尾
    int items;//当前Queue中的items数量
    const int qsize;//最大的items数量
    //preemptive definitions to prevent public copying
    Queue(const Queue & q):qsize(0) {}
    Queue & operator=(const Queue & q){return * this;}
public:
    Queue(int qs = Q_SIZE);//create queue with a qs limit
    ~Queue();
    bool isempty() const;
    bool isfull() const;
    int queuecount() const;
    bool enqueue(const Item & item);//add item to end
    bool dequeue(Item & item);//remoove item from front
};
#endif	// QUEUE_H_